function data = loadDataFromList(listfile, listname)
% loadDataFromList
%
% Example of usage (from command line):
% data = loadDataFromList('lists_retroM1', ...
% 'CORTICOSPINAL_pyramidal_neurons_in_M1_L5AB');
%   P1 = 'Rm'; V1 = showDataFromList(data, P1);
%   P2 = 'Cm'; V2 = showDataFromList(data, P2);
%   figure; plot(V1,V2, 'ro'); xlabel(P1); ylabel(P2);

% gs jan 2008
% ---------------------------------------------------
if nargin == 0
    listfile = 'lists_retroM1';
    listname = 'CORTICOSPINAL_pyramidal_neurons_in_M1_L5AB';
end
list = eval([listfile '(''' listname ''')']);
data.listfile = listfile;
data.listname = listname;
data.list = list;
data.numCells = size(data.list, 1);
for n = 1 : data.numCells
    try
        data.cellData{n} = eval([data.list{n}]);
    catch
        disp(['Problem loading number ' num2str(n)]);
    end
end